﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yes.Domain.Enum;

namespace Yes.Application.Article.Dto
{
    public  class ArticleAddDto
    {

        /// <summary>
        /// ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        [Required(ErrorMessage = "请选择分类")]
        public int CategoryId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Required(ErrorMessage = "请输入标题")]
        [StringLength(50,ErrorMessage = "标题长度为1到50个字符")]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        [StringLength(200, ErrorMessage = "摘要长度为0到200个字符")]
        public string Summary { get; set; }

        [StringLength(50, ErrorMessage = "标签长度为0到50个字符")]
        public string Tag { get; set; }


        /// <summary>
        /// 封面图
        /// </summary>
        public string Img { get; set; }

        /// <summary>
        /// 是否允许评论
        /// </summary>
        public bool CanComment { get; set; }

        /// <summary>
        /// 密码，不为空时需要输入密码才可查看
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 排序值
        /// </summary>
        public int SortId { get; set; }

        /// <summary>
        /// 文章类型
        /// </summary>
        public ArticleTypeEnum Type { get; set; }

        /// <summary>
        /// 父文章ID
        /// </summary>
        public int ParentId { get; set; }


        /// <summary>
        /// 文章状态
        /// </summary>
        public ArticleStatusEnum Status { get; set; }

    }
}
